package com.ficus.road.maintain.file;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author xiawen yang
 * @date 2022/6/20 下午9:12
 */
@AllArgsConstructor
@Getter
public enum FileStorageEnum {

    OSS("oss", OSSFileClient.class),

    OBS("obs", OBSFileClient.class);

    private final String clientName;

    private final Class<? extends FileClient> clientClass;

    public static FileStorageEnum getByClientName(String clientName) {
        return ArrayUtil.firstMatch(o -> o.getClientName().equals(clientName), values());
    }
}
